#打印
# name = "tom"
# age = 30
# print("name is:"+name+",age is:" + str(age))      #字符串拼接
# print("name is: %s, age is :%d" %(name,age))
# print("%s,%d" %(name,age))    #占位符
#分支与循环
# a = 2
# b =3
# if a >b:
#     print("a大")
# else:
#     print("b大")

# a =3                            if语句
# c = input("请输入你的值")
# if c == a:
#     print("一致")
# else:
#     print("继续努力")

# if True:              布尔判断
#     print("true")
# else:
#     print("flase")

# result = input("请输入成绩：")
# result = int(result)
# if result >= 90:
#     print("优秀")                                #if
# elif result >= 75:
#     print("好")
# elif result >= 60:
#     print("良好")
# else:
#     print("不及格")

#for循环
# for i in "hello":
#     print(i)
# subject = ["人工智能","数据通信","电工电子技术","办公自动化","ps","java",]
# for i in subject:
#     print(i)
# for i in range(100):                             遍历
#     print(i)
# for i in range(1,100,2):
#     print(i)

#  列表 元组  字典
# lists = [1,2,3,4,5,6,7,8,9]     # 定义
# print(lists)
# print(lists[0])                  #取值
# print(lists[-1])
# lists[0] = 4                       #改值
# print(lists)
# lists.append("c")                #在末尾添加元素
# print(lists)
# lists.pop(2)                    #删除元素
# print(lists)

# 元组
# tup1 = ("a","b","c","1","2")
# tup2 = ("1","2","3")
# print(tup1[0])            #查看元组
# print(tup1[::2])
# tup3 = tup1 +tup2          #元组连接
# print(tup3)

#字典
# dicts = {"name":"王海成","age":"20"}      #定义
# print(dicts["name"])
# print(dicts)
# print(dicts["age"])            #根据键取值
# dicts["age"] = 90               #根据键改变值
# print(dicts["age"])
# dicts.pop("name")      #删除键是name的项
# print(dicts)

# 函数
# def add(a,b):
#     print(a+b)
# add(2,5)

# def add(a,b):
#     return a + b                         # 返回值
# c = add(9,8)
# print(c)

# def add(a=1,b=2):
#     return a + b
# c1 = add()
# c2 = add(3,6)
# print(c1)
# print(c2)

# 类和方法
# class Myclass(object):                                    #定义Myclass类
#     def say_hello(self,name):
#         return "hello,"  + name
# mc = Myclass()                                            #调用Myclass类
# print(mc.say_hello("王海成"))

# class A:
#     def __init__(self,a,b):
#         self.a = int(a)
#         self.b = int(b)
#     def add(self):
#         return self.a + self.b
# count = A(3,5)
# print(count.add())

